package com.mycloud.utils;


import com.mycloud.enums.ResultEnum;
import com.mycloud.vo.ResultVO;

/**
 * Created by PC on 2018/12/26.
 */

public class ResultVOUtil {

    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(200);
        resultVO.setData(object);
        return resultVO;
    }

    public static ResultVO success() {
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(200);
        return resultVO;
    }


    public static ResultVO error(ResultEnum resultEnum) {
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(resultEnum.getCode());
        resultVO.setMsg(resultEnum.getMessage());
        return resultVO;
    }
}
